# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: John Vogel <jvogel@stygian.me>
maintainer="John Vogel <jvogel@stygian.me>"
pkgname=xboard
pkgver=4.9.1
pkgrel=4
pkgdesc="Graphical chessboard for the X Window System"
url="https://www.gnu.org/software/xboard"
arch="all"
license="GPL-3.0-or-later"
options="!check" # no test suite
makedepends="
	autoconf
	automake
	cairo-dev
	gtk+2.0-dev
	librsvg-dev
	libtool
	texinfo
	xdg-utils
	"
source="https://ftp.gnu.org/gnu/xboard/xboard-$pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-lang"

prepare() {
	default_prepare
	sed -i s/fairymax/gnuchess/ \
		gtk/xboard.h \
		xaw/xboard.h \
		xboard.conf \
		xboard.man \
		xboard.info \
		xboard.texi
	
	autoreconf -fvi
}

build() {
	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr \
		--enable-zippy
	make CFLAGS="$CFLAGS -fcommon"
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
7c6f17450edc3f56d5987f6363da01633850b87b0d6664524a4697216dc66aa58f84314ba57ee68aebfbb01ef96995e34be4e98fb4a5124e3f5090690f91ae08  xboard-4.9.1.tar.gz
"
